const BaseController = require('./baseController');
module.exports = class IndexController extends BaseController {

  api(ctx, next) {
    ctx.body = {
      a: 1,
      b: 2
    };
  }

  async page404(ctx, next) {
    await ctx.render('404', {
      asset: {},
      title: '404'
    });
  }

  // 首页
  async index(ctx) {
    await ctx.render('index', {
      asset: ctx.context.asset(['index', 'common', 'vendor']),
      title: 'template title',
      header: 'template header',
      footer: 'template footers',
      data: {
        h1: 'this is h1',
        desc: 'this is desc',
        content: 'this is content'
      }
    });
  }
};
